<template>
	<view class="back-page">
		<view class="back-item" @click="reLaunch('/pages/index/index')">
			<image :src="cloudStorage+'/home.png'" class="icon" mode="widthFix"></image>
		</view>
		<view class="back-item" @click="scrollToTop">
			<image :src="cloudStorage+'/top.png'" class="icon" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	export default {
		name: "Back",
		data() {
			return {

			};
		},
		methods: {
			scrollToTop() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300 // 滚动动画时长，单位为 ms
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.back-page {
		position: fixed;
		bottom: 60rpx;
		right: 30rpx;

		.back-item {
			background-color: #fff;
			height: 90rpx;
			width: 90rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: 50%;
			margin-top: 30rpx;
			box-shadow: 0 0 18rpx 0 #dddddd;

			.icon {
				height: 50rpx;
				width: 50rpx;
			}
		}
	}
</style>